package ucm;

import model.User_Model;

public class UCLoginUser {
    private String name, psw;
    private User_Model user;

    public UCLoginUser(view.Air_Login log) {
        this.user = log.getUserModel();

        this.name = user.getUsername();
        this.psw = user.getPassword();
    }

    public String run() {
        boolean inserted = false;

        if (this.name.isEmpty()) {
            return "Please input your name in the list.";
        } else if (this.psw.isEmpty()) {
            return "Please input your password in the list.";
        } else if (name.length() > 15 || psw.length() > 15) {
            return "Please input user name or password by correct form.";
        } else {
            return new ucm.UCCheckUser(name).run();
        }
    }
}
